<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE FunctionalDependencies #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE UndecidableInstances #-}</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Search for UndecidableInstances to see why this is needed</span><span>
</span><span id="line-7"></span><span class="hs-comment">{- |
Module      :  Control.Monad.Reader.Class
Copyright   :  (c) Andy Gill 2001,
               (c) Oregon Graduate Institute of Science and Technology 2001,
               (c) Jeff Newbern 2003-2007,
               (c) Andriy Palamarchuk 2007
License     :  BSD-style (see the file LICENSE)

Maintainer  :  libraries@haskell.org
Stability   :  experimental
Portability :  non-portable (multi-param classes, functional dependencies)

[Computation type:] Computations which read values from a shared environment.

[Binding strategy:] Monad values are functions from the environment to a value.
The bound function is applied to the bound value, and both have access
to the shared environment.

[Useful for:] Maintaining variable bindings, or other shared environment.

[Zero and plus:] None.

[Example type:] @'Reader' [(String,Value)] a@

The 'Reader' monad (also called the Environment monad).
Represents a computation, which can read values from
a shared environment, pass values from function to function,
and execute sub-computations in a modified environment.
Using 'Reader' monad for such computations is often clearer and easier
than using the 'Control.Monad.State.State' monad.

  Inspired by the paper
  /Functional Programming with Overloading and Higher-Order Polymorphism/,
    Mark P Jones (&lt;http://web.cecs.pdx.edu/~mpj/&gt;)
    Advanced School of Functional Programming, 1995.
-}</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Control.Monad.Reader.Class</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-45"></span><span>    </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier">MonadReader</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><a href="Control.Monad.Reader.Class.html#asks"><span class="hs-identifier">asks</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Cont.html#"><span class="hs-identifier">Control.Monad.Trans.Cont</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Cont</span></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#"><span class="hs-identifier">Control.Monad.Trans.Except</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#"><span class="hs-identifier">Control.Monad.Trans.Error</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#"><span class="hs-identifier">Control.Monad.Trans.Identity</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.List.html#"><span class="hs-identifier">Control.Monad.Trans.List</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#"><span class="hs-identifier">Control.Monad.Trans.Maybe</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#"><span class="hs-identifier">Control.Monad.Trans.Reader</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier">ReaderT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#"><span class="hs-identifier">Control.Monad.Trans.Reader</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">ReaderT</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ask"><span class="hs-identifier">ask</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#local"><span class="hs-identifier">local</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#reader"><span class="hs-identifier">reader</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#"><span class="hs-identifier">Control.Monad.Trans.RWS.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LazyRWS</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier">RWST</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#ask"><span class="hs-identifier">ask</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#local"><span class="hs-identifier">local</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#reader"><span class="hs-identifier">reader</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.RWS.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">StrictRWS</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier">RWST</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#ask"><span class="hs-identifier">ask</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#local"><span class="hs-identifier">local</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#reader"><span class="hs-identifier">reader</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#"><span class="hs-identifier">Control.Monad.Trans.State.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Lazy</span></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.State.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Strict</span></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#"><span class="hs-identifier">Control.Monad.Trans.Writer.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Lazy</span></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.Writer.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Strict</span></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Class.html#"><span class="hs-identifier">Control.Monad.Trans.Class</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier">lift</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-69"></span><span class="hs-comment">-- class MonadReader</span><span>
</span><span id="line-70"></span><span class="hs-comment">--  asks for the internal (non-mutable) state.</span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="hs-comment">-- | See examples in &quot;Control.Monad.Reader&quot;.</span><span>
</span><span id="line-73"></span><span class="hs-comment">-- Note, the partially applied function type @(-&gt;) r@ is a simple reader monad.</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- See the @instance@ declaration below.</span><span>
</span><span id="line-75"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040159"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="MonadReader"><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-var">MonadReader</span></a></span></span><span> </span><span id="local-6989586621679040160"><span class="annot"><a href="#local-6989586621679040160"><span class="hs-identifier hs-type">r</span></a></span></span><span> </span><span id="local-6989586621679040159"><span class="annot"><a href="#local-6989586621679040159"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="#local-6989586621679040159"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679040160"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 707
</span><span>    </span><span class="hs-pragma">{-# MINIMAL</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-pragma hs-type">ask</span></a></span><span> </span><span class="hs-pragma">|</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-pragma hs-type">reader</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">,</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#local"><span class="hs-pragma hs-type">local</span></a></span><span> </span><span class="hs-pragma">#-}</span><span class="hs-cpp">
#endif
</span><span>    </span><span class="hs-comment">-- | Retrieves the monad environment.</span><span>
</span><span id="line-80"></span><span>    </span><span id="ask"><span class="annot"><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-type">ask</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679040159"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040160"><span class="hs-identifier hs-type">r</span></a></span><span>
</span><span id="line-81"></span><span>    </span><span id="local-6989586621679039885"><span class="annot"><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var hs-var">ask</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; m r
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span><span> </span><span class="annot"><span class="annottext">r -&gt; r
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span>    </span><span class="hs-comment">-- | Executes a computation in a modified environment.</span><span>
</span><span id="line-84"></span><span>    </span><span id="local-6989586621679040145"><span id="local"><span class="annot"><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-type">local</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679040160"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679040160"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ The function to modify the environment.</span><span>
</span><span id="line-85"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679040159"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040145"><span class="hs-identifier hs-type">a</span></a></span><span>      </span><span class="hs-comment">-- ^ @Reader@ to run in the modified environment.</span><span>
</span><span id="line-86"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679040159"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040145"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span>    </span><span class="hs-comment">-- | Retrieves a function of the current environment.</span><span>
</span><span id="line-89"></span><span>    </span><span id="local-6989586621679040157"><span id="reader"><span class="annot"><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-type">reader</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679040160"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679040157"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ The selector function to apply to the environment.</span><span>
</span><span id="line-90"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679040159"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040157"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-91"></span><span>    </span><span id="local-6989586621679039882"><span class="annot"><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var hs-var">reader</span></a></span><span> </span><span id="local-6989586621679039877"><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679039877"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-92"></span><span>      </span><span id="local-6989586621679039876"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679039876"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-93"></span><span>      </span><span class="annot"><span class="annottext">a -&gt; m a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679039877"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679039876"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-comment">-- | Retrieves a function of the current environment.</span><span>
</span><span id="line-96"></span><span id="local-6989586621679040150"><span id="local-6989586621679040151"><span id="local-6989586621679040152"><span class="annot"><a href="Control.Monad.Reader.Class.html#asks"><span class="hs-identifier hs-type">asks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040152"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040151"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-97"></span><span>    </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679040152"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679040150"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ The selector function to apply to the environment.</span><span>
</span><span id="line-98"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679040151"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040150"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-99"></span><span id="asks"><span class="annot"><span class="annottext">asks :: forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#asks"><span class="hs-identifier hs-var hs-var">asks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- The partially applied function type is a simple reader monad</span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span id="local-6989586621679040144"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040144"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">-&gt;</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679040144"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-105"></span><span>    </span><span id="local-6989586621679039865"><span class="annot"><span class="annottext">ask :: r -&gt; r
</span><a href="#local-6989586621679039865"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">r -&gt; r
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-106"></span><span>    </span><span id="local-6989586621679039864"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; (r -&gt; a) -&gt; r -&gt; a
</span><a href="#local-6989586621679039864"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span id="local-6989586621679039863"><span class="annot"><span class="annottext">r -&gt; r
</span><a href="#local-6989586621679039863"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679039862"><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679039862"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679039862"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; (r -&gt; r) -&gt; r -&gt; a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">r -&gt; r
</span><a href="#local-6989586621679039863"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-107"></span><span>    </span><span id="local-6989586621679039860"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; r -&gt; a
</span><a href="#local-6989586621679039860"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; r -&gt; a
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span></span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span id="local-6989586621679040134"><span id="local-6989586621679040135"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040135"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040134"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040134"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040135"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-110"></span><span>    </span><span id="local-6989586621679039850"><span class="annot"><span class="annottext">ask :: ReaderT r m r
</span><a href="#local-6989586621679039850"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReaderT r m r
forall (m :: * -&gt; *) r. Monad m =&gt; ReaderT r m r
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ask"><span class="hs-identifier hs-var">ReaderT.ask</span></a></span><span>
</span><span id="line-111"></span><span>    </span><span id="local-6989586621679039849"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; ReaderT r m a -&gt; ReaderT r m a
</span><a href="#local-6989586621679039849"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; ReaderT r m a -&gt; ReaderT r m a
forall r (m :: * -&gt; *) a.
(r -&gt; r) -&gt; ReaderT r m a -&gt; ReaderT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#local"><span class="hs-identifier hs-var">ReaderT.local</span></a></span><span>
</span><span id="line-112"></span><span>    </span><span id="local-6989586621679039847"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; ReaderT r m a
</span><a href="#local-6989586621679039847"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; ReaderT r m a
forall (m :: * -&gt; *) r a. Monad m =&gt; (r -&gt; a) -&gt; ReaderT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#reader"><span class="hs-identifier hs-var">ReaderT.reader</span></a></span></span></span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span id="local-6989586621679040113"><span id="local-6989586621679040114"><span id="local-6989586621679040115"><span id="local-6989586621679040116"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040116"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040115"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040114"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040114"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040115"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040113"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040116"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-115"></span><span>    </span><span id="local-6989586621679039835"><span class="annot"><span class="annottext">ask :: RWST r w s m r
</span><a href="#local-6989586621679039835"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST r w s m r
forall w (m :: * -&gt; *) r s. (Monoid w, Monad m) =&gt; RWST r w s m r
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#ask"><span class="hs-identifier hs-var">LazyRWS.ask</span></a></span><span>
</span><span id="line-116"></span><span>    </span><span id="local-6989586621679039834"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679039834"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; RWST r w s m a -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; r) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#local"><span class="hs-identifier hs-var">LazyRWS.local</span></a></span><span>
</span><span id="line-117"></span><span>    </span><span id="local-6989586621679039831"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; RWST r w s m a
</span><a href="#local-6989586621679039831"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; RWST r w s m a
forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#reader"><span class="hs-identifier hs-var">LazyRWS.reader</span></a></span></span></span></span></span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span id="local-6989586621679040084"><span id="local-6989586621679040085"><span id="local-6989586621679040086"><span id="local-6989586621679040087"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040087"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040086"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040085"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040085"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040086"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040084"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040087"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-120"></span><span>    </span><span id="local-6989586621679039819"><span class="annot"><span class="annottext">ask :: RWST r w s m r
</span><a href="#local-6989586621679039819"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST r w s m r
forall w (m :: * -&gt; *) r s. (Monoid w, Monad m) =&gt; RWST r w s m r
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#ask"><span class="hs-identifier hs-var">StrictRWS.ask</span></a></span><span>
</span><span id="line-121"></span><span>    </span><span id="local-6989586621679039818"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679039818"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; RWST r w s m a -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; r) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#local"><span class="hs-identifier hs-var">StrictRWS.local</span></a></span><span>
</span><span id="line-122"></span><span>    </span><span id="local-6989586621679039815"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; RWST r w s m a
</span><a href="#local-6989586621679039815"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; RWST r w s m a
forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#reader"><span class="hs-identifier hs-var">StrictRWS.reader</span></a></span></span></span></span></span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-125"></span><span class="hs-comment">-- Instances for other mtl transformers</span><span>
</span><span id="line-126"></span><span class="hs-comment">--</span><span>
</span><span id="line-127"></span><span class="hs-comment">-- All of these instances need UndecidableInstances,</span><span>
</span><span id="line-128"></span><span class="hs-comment">-- because they do not satisfy the coverage condition.</span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span id="local-6989586621679040058"><span id="local-6989586621679040059"><span id="local-6989586621679040060"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040060"><span class="hs-identifier hs-type">r'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040059"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040060"><span class="hs-identifier hs-type">r'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Cont.html#ContT"><span class="hs-identifier hs-type">ContT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040058"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040059"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-131"></span><span>    </span><span id="local-6989586621679039801"><span class="annot"><span class="annottext">ask :: ContT r m r'
</span><a href="#local-6989586621679039801"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r' -&gt; ContT r m r'
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">m r'
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-132"></span><span>    </span><span id="local-6989586621679039797"><span class="annot"><span class="annottext">local :: forall a. (r' -&gt; r') -&gt; ContT r m a -&gt; ContT r m a
</span><a href="#local-6989586621679039797"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r'
-&gt; ((r' -&gt; r') -&gt; m r -&gt; m r)
-&gt; (r' -&gt; r')
-&gt; ContT r m a
-&gt; ContT r m a
forall (m :: * -&gt; *) r' r a.
Monad m =&gt;
m r'
-&gt; ((r' -&gt; r') -&gt; m r -&gt; m r)
-&gt; (r' -&gt; r')
-&gt; ContT r m a
-&gt; ContT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Cont.html#liftLocal"><span class="hs-identifier hs-var">Cont.liftLocal</span></a></span><span> </span><span class="annot"><span class="annottext">m r'
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span> </span><span class="annot"><span class="annottext">(r' -&gt; r') -&gt; m r -&gt; m r
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-133"></span><span>    </span><span id="local-6989586621679039792"><span class="annot"><span class="annottext">reader :: forall a. (r' -&gt; a) -&gt; ContT r m a
</span><a href="#local-6989586621679039792"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ContT r m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ContT r m a)
-&gt; ((r' -&gt; a) -&gt; m a) -&gt; (r' -&gt; a) -&gt; ContT r m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r' -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span></span></span></span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span id="local-6989586621679040037"><span id="local-6989586621679040038"><span id="local-6989586621679040039"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040039"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040038"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040037"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040038"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040039"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040037"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-136"></span><span>    </span><span id="local-6989586621679039777"><span class="annot"><span class="annottext">ask :: ErrorT e m r
</span><a href="#local-6989586621679039777"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r -&gt; ErrorT e m r
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-137"></span><span>    </span><span id="local-6989586621679039775"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; ErrorT e m a -&gt; ErrorT e m a
</span><a href="#local-6989586621679039775"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; m (Either e a)) -&gt; ErrorT e m a -&gt; ErrorT e m a
forall (m :: * -&gt; *) e a (n :: * -&gt; *) e' b.
(m (Either e a) -&gt; n (Either e' b))
-&gt; ErrorT e m a -&gt; ErrorT e' n b
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#mapErrorT"><span class="hs-identifier hs-var">mapErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">((m (Either e a) -&gt; m (Either e a))
 -&gt; ErrorT e m a -&gt; ErrorT e m a)
-&gt; ((r -&gt; r) -&gt; m (Either e a) -&gt; m (Either e a))
-&gt; (r -&gt; r)
-&gt; ErrorT e m a
-&gt; ErrorT e m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; m (Either e a) -&gt; m (Either e a)
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-138"></span><span>    </span><span id="local-6989586621679039770"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; ErrorT e m a
</span><a href="#local-6989586621679039770"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ErrorT e m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ErrorT e m a)
-&gt; ((r -&gt; a) -&gt; m a) -&gt; (r -&gt; a) -&gt; ErrorT e m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span></span></span></span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span class="hs-comment">{- | @since 2.2 -}</span><span>
</span><span id="line-141"></span><span id="local-6989586621679040019"><span id="local-6989586621679040020"><span id="local-6989586621679040021"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040021"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040020"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040021"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040019"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040020"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-142"></span><span>    </span><span id="local-6989586621679039756"><span class="annot"><span class="annottext">ask :: ExceptT e m r
</span><a href="#local-6989586621679039756"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r -&gt; ExceptT e m r
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-143"></span><span>    </span><span id="local-6989586621679039754"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; ExceptT e m a -&gt; ExceptT e m a
</span><a href="#local-6989586621679039754"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; m (Either e a))
-&gt; ExceptT e m a -&gt; ExceptT e m a
forall (m :: * -&gt; *) e a (n :: * -&gt; *) e' b.
(m (Either e a) -&gt; n (Either e' b))
-&gt; ExceptT e m a -&gt; ExceptT e' n b
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#mapExceptT"><span class="hs-identifier hs-var">mapExceptT</span></a></span><span> </span><span class="annot"><span class="annottext">((m (Either e a) -&gt; m (Either e a))
 -&gt; ExceptT e m a -&gt; ExceptT e m a)
-&gt; ((r -&gt; r) -&gt; m (Either e a) -&gt; m (Either e a))
-&gt; (r -&gt; r)
-&gt; ExceptT e m a
-&gt; ExceptT e m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; m (Either e a) -&gt; m (Either e a)
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-144"></span><span>    </span><span id="local-6989586621679039749"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; ExceptT e m a
</span><a href="#local-6989586621679039749"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ExceptT e m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ExceptT e m a)
-&gt; ((r -&gt; a) -&gt; m a) -&gt; (r -&gt; a) -&gt; ExceptT e m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span></span></span></span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span id="local-6989586621679040004"><span id="local-6989586621679040005"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040005"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040004"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040005"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-type">IdentityT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679040004"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-147"></span><span>    </span><span id="local-6989586621679039735"><span class="annot"><span class="annottext">ask :: IdentityT m r
</span><a href="#local-6989586621679039735"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r -&gt; IdentityT m r
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-148"></span><span>    </span><span id="local-6989586621679039733"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; IdentityT m a -&gt; IdentityT m a
</span><a href="#local-6989586621679039733"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; IdentityT m a -&gt; IdentityT m a
forall {k1} {k2} (m :: k1 -&gt; *) (a :: k1) (n :: k2 -&gt; *) (b :: k2).
(m a -&gt; n b) -&gt; IdentityT m a -&gt; IdentityT n b
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#mapIdentityT"><span class="hs-identifier hs-var">mapIdentityT</span></a></span><span> </span><span class="annot"><span class="annottext">((m a -&gt; m a) -&gt; IdentityT m a -&gt; IdentityT m a)
-&gt; ((r -&gt; r) -&gt; m a -&gt; m a)
-&gt; (r -&gt; r)
-&gt; IdentityT m a
-&gt; IdentityT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; m a -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-149"></span><span>    </span><span id="local-6989586621679039728"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; IdentityT m a
</span><a href="#local-6989586621679039728"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; IdentityT m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; IdentityT m a)
-&gt; ((r -&gt; a) -&gt; m a) -&gt; (r -&gt; a) -&gt; IdentityT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span></span></span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span id="local-6989586621679039990"><span id="local-6989586621679039991"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039991"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039990"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039991"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.List.html#ListT"><span class="hs-identifier hs-type">ListT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039990"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-152"></span><span>    </span><span id="local-6989586621679039714"><span class="annot"><span class="annottext">ask :: ListT m r
</span><a href="#local-6989586621679039714"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r -&gt; ListT m r
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-153"></span><span>    </span><span id="local-6989586621679039712"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; ListT m a -&gt; ListT m a
</span><a href="#local-6989586621679039712"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m [a] -&gt; m [a]) -&gt; ListT m a -&gt; ListT m a
forall (m :: * -&gt; *) a (n :: * -&gt; *) b.
(m [a] -&gt; n [b]) -&gt; ListT m a -&gt; ListT n b
</span><a href="../../transformers/src/Control.Monad.Trans.List.html#mapListT"><span class="hs-identifier hs-var">mapListT</span></a></span><span> </span><span class="annot"><span class="annottext">((m [a] -&gt; m [a]) -&gt; ListT m a -&gt; ListT m a)
-&gt; ((r -&gt; r) -&gt; m [a] -&gt; m [a])
-&gt; (r -&gt; r)
-&gt; ListT m a
-&gt; ListT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; m [a] -&gt; m [a]
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-154"></span><span>    </span><span id="local-6989586621679039707"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; ListT m a
</span><a href="#local-6989586621679039707"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ListT m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ListT m a) -&gt; ((r -&gt; a) -&gt; m a) -&gt; (r -&gt; a) -&gt; ListT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span></span></span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span id="local-6989586621679039978"><span id="local-6989586621679039979"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039979"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039978"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039979"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039978"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-157"></span><span>    </span><span id="local-6989586621679039693"><span class="annot"><span class="annottext">ask :: MaybeT m r
</span><a href="#local-6989586621679039693"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r -&gt; MaybeT m r
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-158"></span><span>    </span><span id="local-6989586621679039691"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; MaybeT m a -&gt; MaybeT m a
</span><a href="#local-6989586621679039691"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m (Maybe a) -&gt; m (Maybe a)) -&gt; MaybeT m a -&gt; MaybeT m a
forall (m :: * -&gt; *) a (n :: * -&gt; *) b.
(m (Maybe a) -&gt; n (Maybe b)) -&gt; MaybeT m a -&gt; MaybeT n b
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#mapMaybeT"><span class="hs-identifier hs-var">mapMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">((m (Maybe a) -&gt; m (Maybe a)) -&gt; MaybeT m a -&gt; MaybeT m a)
-&gt; ((r -&gt; r) -&gt; m (Maybe a) -&gt; m (Maybe a))
-&gt; (r -&gt; r)
-&gt; MaybeT m a
-&gt; MaybeT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; m (Maybe a) -&gt; m (Maybe a)
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-159"></span><span>    </span><span id="local-6989586621679039686"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; MaybeT m a
</span><a href="#local-6989586621679039686"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; MaybeT m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; MaybeT m a) -&gt; ((r -&gt; a) -&gt; m a) -&gt; (r -&gt; a) -&gt; MaybeT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span></span></span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span id="local-6989586621679039963"><span id="local-6989586621679039964"><span id="local-6989586621679039965"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039965"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039964"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039965"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">Lazy.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039963"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039964"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-162"></span><span>    </span><span id="local-6989586621679039672"><span class="annot"><span class="annottext">ask :: StateT s m r
</span><a href="#local-6989586621679039672"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r -&gt; StateT s m r
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-163"></span><span>    </span><span id="local-6989586621679039670"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; StateT s m a -&gt; StateT s m a
</span><a href="#local-6989586621679039670"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
forall (m :: * -&gt; *) a s (n :: * -&gt; *) b.
(m (a, s) -&gt; n (b, s)) -&gt; StateT s m a -&gt; StateT s n b
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#mapStateT"><span class="hs-identifier hs-var">Lazy.mapStateT</span></a></span><span> </span><span class="annot"><span class="annottext">((m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a)
-&gt; ((r -&gt; r) -&gt; m (a, s) -&gt; m (a, s))
-&gt; (r -&gt; r)
-&gt; StateT s m a
-&gt; StateT s m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; m (a, s) -&gt; m (a, s)
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-164"></span><span>    </span><span id="local-6989586621679039665"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; StateT s m a
</span><a href="#local-6989586621679039665"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; StateT s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; StateT s m a)
-&gt; ((r -&gt; a) -&gt; m a) -&gt; (r -&gt; a) -&gt; StateT s m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span></span></span></span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span id="local-6989586621679039946"><span id="local-6989586621679039947"><span id="local-6989586621679039948"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039948"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039947"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039948"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">Strict.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039946"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039947"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-167"></span><span>    </span><span id="local-6989586621679039651"><span class="annot"><span class="annottext">ask :: StateT s m r
</span><a href="#local-6989586621679039651"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r -&gt; StateT s m r
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-168"></span><span>    </span><span id="local-6989586621679039649"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; StateT s m a -&gt; StateT s m a
</span><a href="#local-6989586621679039649"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
forall (m :: * -&gt; *) a s (n :: * -&gt; *) b.
(m (a, s) -&gt; n (b, s)) -&gt; StateT s m a -&gt; StateT s n b
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#mapStateT"><span class="hs-identifier hs-var">Strict.mapStateT</span></a></span><span> </span><span class="annot"><span class="annottext">((m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a)
-&gt; ((r -&gt; r) -&gt; m (a, s) -&gt; m (a, s))
-&gt; (r -&gt; r)
-&gt; StateT s m a
-&gt; StateT s m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; m (a, s) -&gt; m (a, s)
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-169"></span><span>    </span><span id="local-6989586621679039644"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; StateT s m a
</span><a href="#local-6989586621679039644"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; StateT s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; StateT s m a)
-&gt; ((r -&gt; a) -&gt; m a) -&gt; (r -&gt; a) -&gt; StateT s m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span></span></span></span><span>
</span><span id="line-170"></span><span>
</span><span id="line-171"></span><span id="local-6989586621679039929"><span id="local-6989586621679039930"><span id="local-6989586621679039931"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039931"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039930"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039929"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039930"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-type">Lazy.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039931"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039929"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-172"></span><span>    </span><span id="local-6989586621679039629"><span class="annot"><span class="annottext">ask :: WriterT w m r
</span><a href="#local-6989586621679039629"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r -&gt; WriterT w m r
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-173"></span><span>    </span><span id="local-6989586621679039627"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; WriterT w m a -&gt; WriterT w m a
</span><a href="#local-6989586621679039627"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
forall (m :: * -&gt; *) a w (n :: * -&gt; *) b w'.
(m (a, w) -&gt; n (b, w')) -&gt; WriterT w m a -&gt; WriterT w' n b
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#mapWriterT"><span class="hs-identifier hs-var">Lazy.mapWriterT</span></a></span><span> </span><span class="annot"><span class="annottext">((m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a)
-&gt; ((r -&gt; r) -&gt; m (a, w) -&gt; m (a, w))
-&gt; (r -&gt; r)
-&gt; WriterT w m a
-&gt; WriterT w m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; m (a, w) -&gt; m (a, w)
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-174"></span><span>    </span><span id="local-6989586621679039622"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; WriterT w m a
</span><a href="#local-6989586621679039622"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; WriterT w m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; WriterT w m a)
-&gt; ((r -&gt; a) -&gt; m a) -&gt; (r -&gt; a) -&gt; WriterT w m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span></span></span></span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span id="local-6989586621679039911"><span id="local-6989586621679039912"><span id="local-6989586621679039913"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039913"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039912"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039911"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039912"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-type">Strict.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039913"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039911"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-177"></span><span>    </span><span id="local-6989586621679039607"><span class="annot"><span class="annottext">ask :: WriterT w m r
</span><a href="#local-6989586621679039607"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r -&gt; WriterT w m r
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-178"></span><span>    </span><span id="local-6989586621679039605"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; WriterT w m a -&gt; WriterT w m a
</span><a href="#local-6989586621679039605"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
forall (m :: * -&gt; *) a w (n :: * -&gt; *) b w'.
(m (a, w) -&gt; n (b, w')) -&gt; WriterT w m a -&gt; WriterT w' n b
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#mapWriterT"><span class="hs-identifier hs-var">Strict.mapWriterT</span></a></span><span> </span><span class="annot"><span class="annottext">((m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a)
-&gt; ((r -&gt; r) -&gt; m (a, w) -&gt; m (a, w))
-&gt; (r -&gt; r)
-&gt; WriterT w m a
-&gt; WriterT w m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; r) -&gt; m (a, w) -&gt; m (a, w)
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-179"></span><span>    </span><span id="local-6989586621679039600"><span class="annot"><span class="annottext">reader :: forall a. (r -&gt; a) -&gt; WriterT w m a
</span><a href="#local-6989586621679039600"><span class="hs-identifier hs-var hs-var hs-var hs-var">reader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; WriterT w m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; WriterT w m a)
-&gt; ((r -&gt; a) -&gt; m a) -&gt; (r -&gt; a) -&gt; WriterT w m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(r -&gt; a) -&gt; m a
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="Control.Monad.Reader.Class.html#reader"><span class="hs-identifier hs-var">reader</span></a></span></span></span></span><span>
</span><span id="line-180"></span></pre></body></html>